PowerTCP Mail for .NET
Basic Message Structure



Email messages are comprised of an envelope and its contents. The envelope is rigidly structured and includes data needed for delivery, while the content is the less-structured package delivered to the recipient. When this standard was first proposed, the content was assumed to be text. Of course, the advent of multimedia made it necessary to send non-ASCII files as well. MIME (Multipurpose Internet Mail Extensions) was developed to make this possible. For simplicity, this topic will demonstrate with a message adhering to RFC 822 for transporting ASCII text-only messages. MIME is discussed in the MIME Overview page.

The Headers

The headers contain data pertaining to the content of the message. They are comprised of ASCII text lines consisting of a header field, a colon, and a header field value. There are two types of header fields: structured and unstructured. Structured header fields (such as From and Date) must follow a specific syntax so they can be parsed as needed. Unstructured header fields (such as Subject and Comments) are not required to follow a set syntax. Header fields are not required to be in any specific order, but they are required to appear before the message content.

The following are some commonly used email header fields:

Header Field Description
Cc: Carbon copy. It is a place to specify additional recipients.
Comments: A nonstandard header used by some e-mail clients to specify more information about the sender.
Content-Description:* Human-readable string describes the content of the message.
Content-Id:* A unique MIME identifier that works in a similar fashion to Message-ID.
Content-Transfer-Encoding:* Shows the MIME encoding used.
Content-Type:* Tells MIME-compliant mail programs what type of data is in the cargo.
Date: Specifies date the mail was sent.
Errors-To: A place for mail generated errors.
From: Specifies the user-defined sender of the mail.
Message-ID: A unique identifier assigned to the message.
MIME-Version:* Specifies the MIME version used by the sender.
Organization: A free form header that usually contains the name of the organization.
Priority: Assigns a priority to the message.
Received: Provides a log of the message's history. This field is added to by every mail transport agent that relays the message.
Reply-To: Specifies the reply address.
Return-Path: Contains an address to send errors to during failed deliveries
Sender: Authenticated identity of the agent that sent the message.
Subject: Specifies the user-defined subject of the e-mail.
To: The recipient of the e-mail.

* = These signify MIME headers which will be addressed in more detail in the MIME topic.

In addition to these fields, user-defined fields called extension fields or X-headers, may be added. These are added by the sending client and are only useful if the receiver's client has a method for handling them.

The Message Body

The body is the portion of the email the sender wishes the receiver to receive. It is merely the cargo and is usually made up of the actual text of the e-mail and/or any attachments.

In a simple text email message, both the body and the header are typically made up of 7-bit data, which is compatible with all mail servers, and are less than 1000 characters in line length.

A Basic Text Email

Here is an example composition of a basic text email.

To: test@email.com
Subject: email test
Message:

This is a test message to see the message form.

In this example, the sender simply opens their email client, specifies the receiver and the subject, writes a quick note and sends the mail. The sent message looks something like this:

Return-Path: <test@email.com>
Received: from YOURCOMPUTER ([192.168.0.0]) by yourserver.com
          (Post.Office MTA v3.5 release 215 ID# 0-
          54045U100L2S100V35)
          with ESMTP id com for <me@test.com>;
          Thu, 1 Feb 2001 16:46:38 -0500
To: test@email.com
From: me@test.com
Subject: email test
Message-ID: <0000c93a04003b07d1@[192.168.0.0]>
Date: Thu, 01 Feb 2001 16:47:39 -0500

This is a test message to see the message form.

The first 11 lines are the email headers. In this example, the only user-defined headers are the "From" header and the "Subject" header. The others were added by the email client and mail servers during the message's journey. Since no MIME headers are present in the message, the content is assumed to be ASCII text. To send a more sophisticated message (for example, one with attachments), MIME (Multipurpose Internet Mail Extensions) is required. MIME specifies how to format non-ASCII messages and is discussed in the MIME Overview.

See Also

Components


PowerTCP Mail for .NET Documentation Version 4.3
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic